package com.itheima.juc03;

import java.util.concurrent.Callable;

/**
 * @author li
 * Callable后面有个泛型参数类型，表示多线程结果的数据类型
 */
public class MyCallable implements Callable<String> {
    @Override
    public String call() {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        return Thread.currentThread().getName() + sum;
    }
}
